import React, { Component } from 'react';
import Routerview from '../../router/RouterView';
import { NavLink } from 'react-router-dom'
class Index extends Component {
	render() {
		// 来自于一级Routerview 传递过来了
		const { routes } = this.props
		return (
			<div className="home">
				<div className="main">
					{/* 二级路由出口 */}
					<Routerview routes={routes}></Routerview>
				</div>

				<div className="footer">
					{
						routes.length > 0 && routes.map((v, i) => {
							return <NavLink key={i} to={v.path}>{v.title}</NavLink>
						})
					}
				</div>
			</div>
		);
	}
}

export default Index;

